<template>
  <div id="app" >
    <router-view/>
  </div>
</template>

<style lang="less">

</style>




<script>
//在页面加载时读取sessionStorage里的状态信息
if (sessionStorage.getItem("store") ) {
  this.$store.replaceState(Object.assign({},this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
}
//在页面刷新时将vuex里的信息保存到sessionStorage里
window.addEventListener("beforeunload",()=>{
  sessionStorage.setItem("store",JSON.stringify(this.$store.state))
})

export default {
methods:{
  setBanNiang(){
    window.L2Dwidget.init({
      "model": {
        jsonPath: "./libs/live2dw/live2d-widget-model-shizuku/assets/shizuku.model.json",
        "scale": 1
      },
      "display": {
        "position": "right",
        "width": 150,
        "height": 300,
        "hOffset": 0,
        "vOffset": -20,
        zIndex: -1
      },
      "mobile": {
        "show": true,
        "scale": 0.5
      },
      "react": {
        "opacityDefault": 0.2,
        "opacityOnHover": 0.2
      }
    });

  }
},
  mounted() {
  this.setBanNiang();
  }

}
</script>
